package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.NewsContent;
import cn.wolfcode.trip.base.domain.NewsPage;
import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.CollectQueryObject;
import cn.wolfcode.trip.base.query.NewsPageQueryObject;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface NewsPageMapper {
    int deleteByPrimaryKey(Long id);

    int insert(NewsPage entity);

    NewsPage selectByPrimaryKey(Long id);

    List<NewsPage> selectAll();

    int updateByPrimaryKey(NewsPage entity);


    NewsContent selectNewContentByNewsId(Long newsId);


    List<NewsPage> selectForList(NewsPageQueryObject qo);

    /**
     *通过关键字查询日报
     * @param qo
     * @return
     */
    List<NewsPage> selectByKeyword(SearchQueryObject qo);

    /**
     * 根据关键字查询该日报的总数
     * @param keyword
     * @return
     */
    int selectCountByKeyword(String keyword);

    /**
     * 查询用户收藏的日报
     * @param qo
     * @return
     */
    List<NewsPage> selectForCollect(CollectQueryObject qo);


    /**
     * 查询所有日报,
     * @param qo
     * @return
     */
    List<NewsPage> selectForListApp(NewsPageQueryObject qo);
}